home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _44A0E134DDD242FA997FC1C77345DE9C < prev    next >
Encoding:
Text File  |  2004-01-06  |  4.1 KB  |  110 lines

  1. --------------------------------------------------
  2. --    Created By: Petar
  3. --   Description: <short_description>
  4. --------------------------
  5. --
  6.  
  7. AIBehaviour.P34Idle = {
  8.     Name = "P34Idle",
  9.     pathname = "",
  10.  
  11.     -- SYSTEM EVENTS            -----
  12.     ---------------------------------------------
  13.     OnSelected = function( self, entity )    
  14.     end,
  15.     ---------------------------------------------
  16.     OnSpawn = function( self, entity )
  17.         -- called when enemy spawned or reset
  18.         AI:CreateGoalPipe("idle_loop");
  19.         AI:PushGoal("idle_loop","timeout",1,0.5);
  20.         AI:PushGoal("idle_loop","lookaround",1,6);
  21.         AI:PushGoal("idle_loop","lookaround",0,-1);
  22.         AI:PushGoal("idle_loop","approach",1,0.5);
  23.         AI:PushGoal("idle_loop","timeout",1,3);
  24.         entity:SelectPipe(0,"idle_loop");
  25.  
  26.         AI:CreateGoalPipe("attack_threat");
  27.         AI:PushGoal("attack_threat","run",0,1);
  28.         AI:PushGoal("attack_threat","firecmd",0,1);
  29.         AI:PushGoal("attack_threat","approach",0,0.5);
  30.         AI:PushGoal("attack_threat","timeout",1,1);
  31.         AI:PushGoal("attack_threat","strafe",0,-1);
  32.         AI:PushGoal("attack_threat","timeout",1,1);
  33.         AI:PushGoal("attack_threat","strafe",0,1);
  34.         AI:PushGoal("attack_threat","timeout",1,1);
  35.         AI:PushGoal("attack_threat","strafe",0,0);
  36.         AI:PushGoal("attack_threat","branch",0,-5);
  37.  
  38.         AI:CreateGoalPipe("seek_target");
  39.         AI:PushGoal("seek_target","run",0,1);
  40.         AI:PushGoal("seek_target","approach",1,2);
  41.         AI:PushGoal("seek_target","timeout",1,2);
  42.         AI:PushGoal("seek_target","strafe",0,1);
  43.         AI:PushGoal("seek_target","timeout",1,0.5);
  44.         AI:PushGoal("seek_target","strafe",0,-1);
  45.         AI:PushGoal("seek_target","timeout",1,1);
  46.         AI:PushGoal("seek_target","strafe",0,0);
  47.         AI:PushGoal("seek_target","lookaround",1,4);
  48.         AI:PushGoal("seek_target","lookaround",1,4);
  49.         AI:PushGoal("seek_target","lookaround",1,4);
  50.  
  51.     end,
  52.     ---------------------------------------------
  53.     OnActivate = function( self, entity )
  54.         -- called when enemy receives an activate event (from a trigger, for example)
  55.     end,
  56.     ---------------------------------------------
  57.     OnNoTarget = function( self, entity )
  58.         -- called when the enemy stops having an attention target    
  59.     end,
  60.     ---------------------------------------------
  61.     OnPlayerSeen = function( self, entity, fDistance )
  62.         -- called when the enemy sees a living player
  63.         entity:SelectPipe(0,"attack_threat");
  64.     end,
  65.     ---------------------------------------------
  66.     OnEnemySeen = function( self, entity )
  67.         -- called when the enemy sees a foe which is not a living player
  68.     end,
  69.     ---------------------------------------------
  70.     OnFriendSeen = function( self, entity )
  71.         -- called when the enemy sees a friendly target
  72.     end,
  73.     ---------------------------------------------
  74.     OnDeadBodySeen = function( self, entity )
  75.         -- called when the enemy a dead body
  76.     end,
  77.     ---------------------------------------------
  78.     OnEnemyMemory = function( self, entity )
  79.         -- called when the enemy can no longer see its foe, but remembers where it saw it last
  80.         entity:SelectPipe(0,"seek_target");
  81.     end,
  82.     ---------------------------------------------
  83.     OnInterestingSoundHeard = function( self, entity )
  84.         -- called when the enemy hears an interesting sound
  85.         entity:SelectPipe(0,"seek_target");
  86.     end,
  87.     ---------------------------------------------
  88.     OnThreateningSoundHeard = function( self, entity )
  89.         -- called when the enemy hears a scary sound
  90.         System:LogToConsole("THREATENING SOUND ====================================================");
  91.         entity:SelectPipe(0,"seek_target");
  92.     end,
  93.     ---------------------------------------------
  94.     OnReload = function( self, entity )
  95.         -- called when the enemy goes into automatic reload after its clip is empty
  96.     end,
  97.     ---------------------------------------------
  98.     OnGroupMemberDied = function( self, entity )
  99.         -- called when a member of the group dies
  100.     end,
  101.     ---------------------------------------------
  102.     OnNoHidingPlace = function( self, entity, sender )
  103.         -- called when no hiding place can be found with the specified parameters
  104.     end,    
  105.     ---------------------------------------------
  106.     OnReceivingDamage = function ( self, entity, sender)
  107.         -- called when the enemy is damaged
  108.     end,
  109.  
  110. }